var app = getApp();

Page({
  data: {
    none: [{
      img: "https://lg-o8nytxik-1257013711.cos.ap-shanghai.myqcloud.com/微信图片_20180727121929.png",
      con: "暂无信息"
    }],
    Height: '',
    stype: 1,
    people: []
  },
  option: function(e) {
    let that = this;
    that.setData({
      stype: e.target.id
    })

    let stype = that.data.stype;
    if (stype == '专家坐诊') {
      this.getAlldocfuwulist(stype)

    }
    if (stype == '手术快约') {
      this.getAlldocfuwulist(stype)

    }
    if (stype == '点名会诊') {
      this.getAlldocfuwulist(stype)

    }
  },
  personal: function() {
    wx.navigateTo({
      url: "/hyb_yl/backstageFollowUp/pages/healthRecord/healthRecord"
    });
  },
  dialOut: function(e) {
    console.log(e)
    let a = e.target.dataset.phonenumber;
    wx.makePhoneCall({
      phoneNumber: a
    })
  },
  onLoad: function(options) {
    let that = this;
    let a = ''
    var zid = options.zid
    wx.getSystemInfo({
      success: function(res) {
        a = res.windowHeight;
      },
    })
    that.setData({
      Height: a - 80,
      stype: '专家坐诊',
      zid: zid
    })
    this.getAlldocfuwulist()
  },
  getAlldocfuwulist: function(stype) {
    var that = this
    var zid = that.data.zid
    var stype = that.data.stype
    console.log(stype)
    app.util.request({
      'url': "entry/wxapp/Alldocfuwulist",
      data: {
        zid: zid,
        stype: stype,
        op: 'all'
      },
      header: {
        'content-type': 'application/json'
      },
      success: function(res) {
        console.log(res)
        that.setData({
          people: res.data
        })
      },
      fail: function(err) {
        console.log(err)
      },
    })
  },
  overdz: function(e) {
    var that = this
    var fu_id = e.currentTarget.dataset.fu_id
    console.log(e)
    app.util.request({
      'url': "entry/wxapp/Alldocfuwulist",
      data: {
        fu_id: fu_id,
        op: 'quren'
      },
      header: {
        'content-type': 'application/json'
      },
      success: function(res) {
        console.log(res)
        that.setData({

        })
      },
      fail: function(err) {
        console.log(err)
      },
    })
  }

});